import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:ichinesereader/controller/user.dart';
import 'package:ichinesereader/widgets/dialogs/switchClassDialog.dart';
import '../../themes/appTheme.dart';

class FloatingActionButtonsTeacherSwitchClass extends StatelessWidget {
  FloatingActionButtonsTeacherSwitchClass({
    Key? key,
  }) : super(key: key);

  Widget build(BuildContext context) {
    final UserController _userController = Get.find();

    return Column(
      mainAxisAlignment: MainAxisAlignment.end,
      children: [
        Visibility(
          visible: _userController.myClasses.isNotEmpty &&
              _userController.myClasses.length > 1,
          child: SizedBox(
            height: 45,
            width: 45,
            child: FloatingActionButton(
              backgroundColor: Get.isDarkMode
                  ? Theme.of(context).primaryColorDark
                  : AppTheme.colors.pinkBtn,
              foregroundColor:
                  Get.isDarkMode ? Colors.black : AppTheme.colors.lightOrange,
              tooltip: 'Switch Class'.tr,
              heroTag: 'switchclass88990000',
              onPressed: () {
                showGeneralDialog(
                    context: context,
                    transitionDuration: Duration(milliseconds: 400),
                    pageBuilder: (bc, ania, anis) {
                      return SwitchTeacherClassDialog();
                    });
              },
              child: Icon(
                Icons.class_outlined,
                color:
                    Get.isDarkMode ? Colors.black : AppTheme.colors.lightPink,
                size: 24,
              ),
            ),
          ),
        ),
        //SizedBox(height: 5),
        // SizedBox(
        //   height: 45,
        //   width: 45,
        //   child: FloatingActionButton(
        //     heroTag: 'balbalhome8899',
        //     backgroundColor: Theme.of(context).primaryColorDark,
        //     foregroundColor: Get.isDarkMode
        //         ? Colors.black
        //         : Theme.of(context).primaryColorLight,
        //     tooltip: 'Home Page'.tr,
        //     onPressed: () {
        //       Get.delete<ReportsController>();
        //       Get.offAndToNamed('/teacher/home');
        //     },
        //     child: Icon(
        //       Icons.home_outlined,
        //       color:
        //           Get.isDarkMode ? Colors.black : Get.theme.primaryColorLight,
        //       size: 24,
        //     ),
        //   ),
        // ),
      ],
    );
  }
}
